<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>海南空管局项目管理平台</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/huazhi/lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/huazhi/css/public.css" media="all">
    <link rel="shortcut icon" href="<%=request.getContextPath()%>/huazhi/images/favicon.ico"/>
    <link rel="stylesheet" href="<%=request.getContextPath()%>/huazhi/lib/process/demo.css" media="all">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/huazhi/lib/process/chart.css">
</head>
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <div class="layui-row">
                <div class="layui-col-md12">
                    <div class="layui-tab-content">
                        <div class="layui-col-md6">
                            <div class="layui-form">
                                <div class="layui-form-item">
                                    <div class="layui-col-lg11">
                                        <label class="layui-form-label">流程名</label>
                                        <div class="layui-input-block">
                                            <input type="text" id="processName"
                                                   autocomplete="off"
                                                   class="layui-input" disabled>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-col-xs11">
                                        <label class="layui-form-label">流程类别</label>
                                        <div class="layui-input-block">
                                            <select id="types" disabled>
                                                <option value="">请选流程类别</option>
                                                <option value="one">采购流程</option>
                                                <option value="two">领用流程</option>
                                                <option value="three">出库流程</option>
                                                <option value="four">入库流程</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-col-lg11">
                                        <label class="layui-form-label">描述</label>
                                        <div class="layui-input-block">
                                            <textarea class="layui-textarea" name="processRemarks" id="processRemarks"
                                                      disabled></textarea>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md12">
                            <div id="demo-chart">
                                <!-- <div class="startpoint point window node" style="left: 150px; top:20px; background-color:green" data-nodetype="startpoint" id="startpoint">Start</div>
                                <div class="endpoint point window node" style="left: 150px; top:350px" data-nodetype="endpoint" id="endpoint">End</div> -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<input type="hidden" id="jsonOutputForDetail">
<script src="<%=request.getContextPath()%>/huazhi/lib/layui-v2.5.5/layui.all.js"></script>
<script src="<%=request.getContextPath()%>/huazhi/lib/process/jsPlumb.min.js"></script>
<script src="<%=request.getContextPath()%>/huazhi/lib/process/chart.js"></script>
<script src="<%=request.getContextPath()%>/huazhi/lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
<script>
    function child(tid) {
        layui.use(['table', 'form'], function () {
            var $ = layui.$
                , form = layui.form
                , laydate = layui.laydate,
                layer = layui.layer;

            var _createChart = function () {
                return new Chart($('#demo-chart'), {})
            };

            $.ajax({
                type: "post",
                url: "<%=request.getContextPath()%>/rest/process/getProcessDetail",
                dataType: "json",
                data: "tid=" + tid,
                async: false,
                success: function (data) {
                    $("#processName").val(data.title)
                    $("#types").val(data.types)
                    $("#processRemarks").val(data.remarks)
                    chart = _createChart();
                    chart.fromJson(JSON.stringify(data.forShow));
                    form.render('select');
                }
            })
        });
    }
</script>
</body>
</html>
